Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple plotting backends #65

Merged
merged 25 commits into from
Feb 8, 2021
Merged

Multiple plotting backends #65

merged 25 commits into from
Feb 8, 2021

Conversation

mmaelicke
Copy link
Owner

With this PR, it has become possible to use plotly instead of matplotlib for plotting. These plot objects integrate much better in web-driven applications using scikit-gstat.

The new sub-module skgstat.plotting has a function to switch backends:

from skgstat import plotting

plotting.backend('plotly')
[...]

Vargriogram.plot()

plotly is not added as a dependency, so it has to be installed manually. The new code didn't change any existing behavior and skgstat can be used just like before.

At the current state, skgstat does not make use of the most powerful features of plotly, as I am just porting the existing plots to plotly. This will be a focus of future developments, to make more of plotly's (and also matplotlib's) features and customizations available.

@redhog , I will add a demo notebook as quick as possible and then I'm curious to hear your thoughts on this.

@codecov-io
Copy link

codecov-io commented Dec 1, 2020

Codecov Report

Merging #65 (784b929) into master (a2f7002) will increase coverage by 7.05%.
The diff coverage is 92.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #65      +/-   ##
==========================================
+ Coverage   82.76%   89.82%   +7.05%     
==========================================
  Files          13       13              
  Lines        1654     1484     -170     
==========================================
- Hits         1369     1333      -36     
+ Misses        285      151     -134     
Impacted Files Coverage Δ
skgstat/Variogram.py 96.35% <89.47%> (-0.10%) ⬇️
skgstat/DirectionalVariogram.py 90.90% <100.00%> (+0.06%) ⬆️
skgstat/SpaceTimeVariogram.py 81.94% <100.00%> (+21.64%) ⬆️
skgstat/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2f7002...784b929. Read the comment docs.

@redhog
Copy link
Collaborator

redhog commented Dec 1, 2020

Cool.
I might be able to provide some bokeh based plotting routines if you're interested... But the code would need some serious cleanup first :P

@mmaelicke
Copy link
Owner Author

Cool.
I might be able to provide some bokeh based plotting routines if you're interested... But the code would need some serious cleanup first :P

Yeah, always!
In fact I rolled a dice whether to implement bokeh or plotly first :). Personally, I use plotly more often, because I use dash on a very frequent basis.
But the new code is designed with more that just matplotlib and plotly in mind. Thus it should be quite easy to implement bokeh once the plotly stuff is finished.

@mmaelicke mmaelicke merged commit a2c694f into master Feb 8, 2021
@mmaelicke mmaelicke deleted the plotting-backend branch February 8, 2021 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants